package com.dragon.mmochat.model.enumType;

//帮派等级
public enum MmochatGangLevelType {
	初级(0, 0, 50, 0, 10), 中级(1, 1000000, 100, 1, 20), 高级(2, 3000000, 200, 2, 40), 顶级(
			3, 15000000, 300, 3, 60);

	int value;
	int maxMemberNum; // 成员上限
	int maxViceMasterNum; // 副帮主人数上限
	int maxVipMemberNum; // 精英人数上限
	int buildNeed; // 建设度要求

	MmochatGangLevelType(int value, int buildNeed, int maxMemberNum,
			int maxViceMasterNum, int maxVipMemberNum) {
		this.value = value;
		this.buildNeed = buildNeed;
		this.maxMemberNum = maxMemberNum;
		this.maxViceMasterNum = maxViceMasterNum;
		this.maxVipMemberNum = maxVipMemberNum;
	}

	// 下一等级
	public static MmochatGangLevelType getNextLevelType(
			MmochatGangLevelType curLevel) {
		switch (curLevel) {
		case 初级:
			return MmochatGangLevelType.中级;
		case 中级:
			return MmochatGangLevelType.高级;
		case 高级:
			return MmochatGangLevelType.顶级;
		}
		return MmochatGangLevelType.顶级;
	}

	// 最高等级
	public static MmochatGangLevelType getMaxLevelType() {
		return MmochatGangLevelType.顶级;
	}

	public int getValue() {
		return value;
	}

	public int getMaxMemberNum() {
		return maxMemberNum;
	}

	public int getMaxViceMasterNum() {
		return maxViceMasterNum;
	}

	public int getMaxVipMemberNum() {
		return maxVipMemberNum;
	}

	public int getBuildNeed() {
		return buildNeed;
	}

	public static MmochatGangLevelType get(int value) {
		for (MmochatGangLevelType type : MmochatGangLevelType.values()) {
			if (type.getValue() == value) {
				return type;
			}
		}
		return null;
	}

}
